/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.eventos.be;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author oscar
 */
@Entity
@Table(name = "eca_detalle_ingresos")
@NamedQueries({@NamedQuery(name = "DetalleIngresosEventos.findAll", query = "SELECT d FROM DetalleIngresosEventos d"), @NamedQuery(name = "DetalleIngresosEventos.findByDinCodigo", query = "SELECT d FROM DetalleIngresosEventos d WHERE d.dinCodigo = :dinCodigo"), @NamedQuery(name = "DetalleIngresosEventos.findByDinfechaInicio", query = "SELECT d FROM DetalleIngresosEventos d WHERE d.dinfechaInicio = :dinfechaInicio"), @NamedQuery(name = "DetalleIngresosEventos.findByDinfechaFin", query = "SELECT d FROM DetalleIngresosEventos d WHERE d.dinfechaFin = :dinfechaFin"), @NamedQuery(name = "DetalleIngresosEventos.findByDinMonto", query = "SELECT d FROM DetalleIngresosEventos d WHERE d.dinMonto = :dinMonto")})
public class DetalleIngresosEventos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "din_codigo")
    private Integer dinCodigo;
    @Column(name = "din_fechaInicio")
    @Temporal(TemporalType.DATE)
    private Date dinfechaInicio;
    @Column(name = "din_fechaFin")
    @Temporal(TemporalType.DATE)
    private Date dinfechaFin;
    @Column(name = "din_monto")
    private Double dinMonto;
    @JoinColumn(name = "pre_codigo", referencedColumnName = "pre_codigo")
    @ManyToOne(fetch = FetchType.LAZY)
    private Preevento preCodigo;
    @JoinColumn(name = "tpe_codigo", referencedColumnName = "tpe_codigo")
    @ManyToOne(fetch = FetchType.LAZY)
    private TipoParticipanteEvento tpeCodigo;
    @JoinColumn(name = "tpi_codigo", referencedColumnName = "tpi_codigo")
    @ManyToOne(fetch = FetchType.LAZY)
    private TipoIngresoEventos tpiCodigo;
    @Column(name="nroCuotas")
    private Integer nroCuotas;

    public DetalleIngresosEventos() {
    }

    public DetalleIngresosEventos(Integer dinCodigo) {
        this.dinCodigo = dinCodigo;
    }

    public int getNroCuotas() {
        return nroCuotas;
    }

    public void setNroCuotas(int nroCuotas) {
        this.nroCuotas = nroCuotas;
    }

    public Integer getDinCodigo() {
        return dinCodigo;
    }

    public void setDinCodigo(Integer dinCodigo) {
        this.dinCodigo = dinCodigo;
    }

    public Date getDinfechaInicio() {
        return dinfechaInicio;
    }

    public void setDinfechaInicio(Date dinfechaInicio) {
        this.dinfechaInicio = dinfechaInicio;
    }

    public Date getDinfechaFin() {
        return dinfechaFin;
    }

    public void setDinfechaFin(Date dinfechaFin) {
        this.dinfechaFin = dinfechaFin;
    }

    public Double getDinMonto() {
        return dinMonto;
    }

    public void setDinMonto(Double dinMonto) {
        this.dinMonto = dinMonto;
    }

    public Preevento getPreCodigo() {
        return preCodigo;
    }

    public void setPreCodigo(Preevento preCodigo) {
        this.preCodigo = preCodigo;
    }

    public TipoParticipanteEvento getTpeCodigo() {
        return tpeCodigo;
    }

    public void setTpeCodigo(TipoParticipanteEvento tpeCodigo) {
        this.tpeCodigo = tpeCodigo;
    }

    public TipoIngresoEventos getTpiCodigo() {
        return tpiCodigo;
    }

    public void setTpiCodigo(TipoIngresoEventos tpiCodigo) {
        this.tpiCodigo = tpiCodigo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (dinCodigo != null ? dinCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DetalleIngresosEventos)) {
            return false;
        }
        DetalleIngresosEventos other = (DetalleIngresosEventos) object;
        if ((this.dinCodigo == null && other.dinCodigo != null) || (this.dinCodigo != null && !this.dinCodigo.equals(other.dinCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.eventos.be.DetalleIngresosEventos[dinCodigo=" + dinCodigo + "]";
    }

}
